//
//  AppDelegate.m
//  ObjectCDemo
//
//  Created by 蓝晓彬 on 2022/5/12.
//

#import "AppDelegate.h"
#import <IMSIotSmart/IMSIotSmart.h>
#import <IMLDeviceCenter/IMLDeviceCenter.h>
#import <IMSIotSmart/IMSIotSmart+scope.h>


@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    NSLog(@"打印log: didFinishLaunchingWithOptions IMSIotSmart 初始化start");
    //1、配置SDK。
    IMSIotSmartConfig *config = [IMSIotSmartConfig new];
    config.regionType = REGION_ALL; //取值范围参见枚举类型 `IMSRegionType`
    //这是默认配置，可以根据实际情况调整
    [IMSIotSmart sharedInstance].config = config;
    //2、设置安全图片。
    [[IMSIotSmart sharedInstance] setAuthCode:@"china_production"];
    [[IMSIotSmart sharedInstance] setDebug:true];
    //3、启动初始化
    NSLog(@"打印log: didFinishLaunchingWithOptions start");
    [[IMSIotSmart sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    // 存储 App 启动状态，用于后续初始化调用
    NSLog(@"打印log: didFinishLaunchingWithOptions IMSIotSmart 初始化完成");
    
    //4、配置App上能看到的产品的范围，PRODUCT_SCOPE_ALL：表示当前项目中已发布和未发布的所有产品；PRODUCT_SCOPE_PUBLISHED：表示只包含已发布产
    [[IMSIotSmart sharedInstance] configProductScope:PRODUCT_SCOPE_ALL];

    
    ///扫描会奔溃xxx
    [[IMLLocalDeviceMgr sharedMgr] startDiscovery:^(NSArray *devices, NSError *err) {
        NSLog(@ "startDiscoveryWithError found");
    }
        ];
    
    return YES;
}



@end
